﻿@model LojaVirtual.Comuns.Clientes.Cliente
@{
    ViewBag.Title = "Details";
}
<h2>
    Details</h2>
<fieldset>
    <legend>Cliente</legend>
    <div class="display-label">
        Nome</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Nome)
    </div>
    <div class="display-label">
        Email</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Email)
    </div>
    <div class="display-label">
        Senha</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Senha)
    </div>
    <div class="display-label">
        Rua</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Rua)
    </div>
    <div class="display-label">
        Numero</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Numero)
    </div>
    <div class="display-label">
        Cep</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Cep)
    </div>
    @if (Model.Compras.Count > 0)
    {
        <fieldset>
            <legend>Compras </legend>
            <table>
                <thead>
                    <tr>
                        <th>Data</th>
                        <th>Pago</th>
                        <th>Itens</th>
                        <th>Total</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model.Compras)
                    {
                        <tr>
                            <td>@item.DataEfetuada</td>
                            <td>@item.PagamentoConfirmado</td>
                            <td>@item.Itens.Count</td>
                            <td>@item.Total</td>
                        </tr>
                    }
                </tbody>
            </table>
        </fieldset>
    }
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.ID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
